// 云函数入口文件
const cloud = require('wx-server-sdk')
// 使用当前云环境
cloud.init({env: 'wang2023-5gng88vf3d3ea81f'});

// 云函数入口函数
exports.main = async (event, context) => {
  const {content,openid } = event;
  try {
    // 过滤敏感词汇
    return await cloud.openapi.security.msgSecCheck({
      openid,
      content: content
    })
  } catch (err) {
    return err;
  }
}